﻿using System;
using System.Web;
using System.Web.UI;
using System.Linq;
using Models;


    public partial class TagAdd : AdminBase
    {
        public int _Id=0;

        protected void Page_Load(object sender, EventArgs e)
        {

            Response.CacheControl = "no-cache";
            if (!string.IsNullOrEmpty(Request.Params["ID"]))
            {
                _Id = int.Parse(HttpContext.Current.Request.QueryString["ID"]);

            }

            if (!Page.IsPostBack)
            {
               
                if (_Id != 0)
                {
                    ShowInfo(_Id);
                }

            }
               
           
        }

        //保存
        protected void btnSave_Click(object sender, EventArgs e)
        {
         
       

            // bll.Add(model);
            //保存日志
            //SaveLogs("[资讯模块]添加文章：" + model.Title);
            //JscriptPrint("文章发布成功啦！", "Add.aspx?classId=" + ddlClassId.SelectedValue, "Success");
        }

        private void ShowInfo(int _id)
        {

            Entities mydb = new Entities();
            {

             User use = mydb.User.First(p => p.UID == _id);    
      
             txtTag.Text = use.ComFile;
        
         
          }
        }


    protected void Button1_Click(object sender, EventArgs e)
    {
        Entities mydb = new Entities();
        {

            User use = mydb.User.First(p => p.UID == _Id);


            use.ComFile = this.txtTag.Text;
            use.state = -1;

            mydb.SaveChanges();

            SendTemplateMeg wxMsg = new SendTemplateMeg();

            wxMsg.SendProMsg("身份认证失败", _Id);

            Response.Write("<script> var Close=1;</script>");

               // JscriptPrint("自定义标签修改成功啦！", "list.aspx", "Success");
            
        }
    }
}

